#include <algorithm>
#include <fstream>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

const ll N=1e5+5;

ifstream fin("duel.in");
ofstream fout("duel.out");

ll r[N];
ll n;

int main(){
    fin>>n;
    for (ll i = 0; i < n; i++){
        fin>>r[i];
    }
    sort(r,r+n);
    ll rest=0;
    ll same_val=1;
    for (ll i = 1; i < n; i++){
        if(r[i]>r[i-1]){
            rest+=same_val;
            same_val=1;
        }
        else{
            same_val++;
        }
        if(rest>0)rest--;
    }
    rest+=same_val;
    fout<<rest<<'\n';
    return 0;
}

/*
抽象。
排个序不久行了。
*/